<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class IPhone {
            constructor(id, name) {
                this.id = id;
                this.uname = name;
            }
            brand = 'apple';
            version = '12 Pro';
            color = 'blue';
            sayHi () {
                console.log('hi');
            }

        }
        const phone = new IPhone(1, '手机');
        console.log(phone.brand);
        console.log(phone.uname);
        console.log(phone.id);
    </script>
</body>
</html>